Skip to content

Add Room encryption docs for Kotlin SDK#393

Open
khawarizmus wants to merge 2 commits intomainfrom
room-encryption
Open

Add Room encryption docs for Kotlin SDK#393
khawarizmus wants to merge 2 commits intomainfrom
room-encryption

Conversation

@khawarizmus
Copy link
Copy Markdown
Contributor

Changes

  • data-encryption.mdx: Added instructions for using encryption with Room in the Kotlin section. Uses PowerSyncConnectionFactoryAsSqliteDriver to wrap an encrypted
    PersistentConnectionFactory and pass it to RoomDatabase.Builder.setDriver.
  • Added pnpm setup with mintlify as a dev dependency.
  • README.md: Updated Quick Start to use pnpm install + npm run dev instead of npx mintlify commands.

The last two points are just for easier use. We can now simply do pnpm dev to spin the docs

@khawarizmus khawarizmus requested review from benitav and simolus3 April 17, 2026 02:53
Comment thread README.md
2. **Install dependencies:**
```
npx mintlify install
pnpm install
Copy link
Copy Markdown
Contributor

@simolus3 simolus3 Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would love not having to install mintlify as a global tool 👍 To ensure this works, maybe we should also update the workflow in .github/workflows/check.yaml (we can even cache pnpm dependencies automatically after upgrading actions/setup-node).

Comment thread package.json
},
"devDependencies": {
"mintlify": "^4.2.520"
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably enable corepack as well, to ensure pnpm is used consistently.

}
```

Depending on your target platform, pass an `AndroidEncryptedDatabaseFactory`, `JavaEncryptedDatabaseFactory`, or `NativeEncryptedDatabaseFactory` to the wrapper. The factory automatically installs the SQLite3MultipleCiphers extension — no manual setup required.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sqlite3mc is a fork, not an extension. But we should mention that the PowerSync extension gets loaded automatically, since it's a manual step with the default Room setup.

Suggested change
Depending on your target platform, pass an `AndroidEncryptedDatabaseFactory`, `JavaEncryptedDatabaseFactory`, or `NativeEncryptedDatabaseFactory` to the wrapper. The factory automatically installs the SQLite3MultipleCiphers extension — no manual setup required.
Depending on your target platform, pass an `AndroidEncryptedDatabaseFactory`, `JavaEncryptedDatabaseFactory`, or `NativeEncryptedDatabaseFactory` to the wrapper. The factory automatically installs the PowerSync SQLite extension, so you can skip the `loadPowerSyncExtension()` step.


For more details, see the [`sqlite3multipleciphers` README](https://github.com/powersync-ja/powersync-kotlin/tree/main/sqlite3multipleciphers) in the PowerSync Kotlin SDK repository.

**Using encryption with Room:**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. But I wonder if we should put this as a section in the guide on using Room, since:

  • this takes up way more space here in a collapsible with large paddings.
  • it's not relevant for everyone using encryption.

So I think it might be better to move this to the page on Room, and add a link from here to that section perhaps.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. Will do that

@cahofmeyr
Copy link
Copy Markdown
Collaborator

Added pnpm setup with mintlify as a dev dependency.
README.md: Updated Quick Start to use pnpm install + npm run dev instead of npx mintlify commands.

@khawarizmus could you please move this to a separate PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants